package com.zzz.product.controller;

/*
 * @author zzr
 * @date: 2025/10/15  17:15
 * @description:
 */

import com.zzz.product.mode.ProductInfo;
import com.zzz.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/product")
@RestController
public class ProductController {
    @Autowired
    private ProductService productService;

    @RequestMapping("/{productId}")
    public ProductInfo getProductById(@PathVariable("productId") Integer productId) {
        ProductInfo productInfo = productService.selectProductById(productId);
        log.info("收到请求：Id:{}",productId);
        return productInfo;
    }
}
